package com.jzr.bedside.ui.adapter

import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.BaseViewHolder
import com.jzr.bedside.R
import com.jzr.bedside.bean.BaseCheckDataBean


class CheckDeptApadter(data: MutableList<BaseCheckDataBean>?) :
    BaseQuickAdapter<BaseCheckDataBean, BaseViewHolder>(
        R.layout.item_dept,
        data
    ) {

     var type: Int? = null   // 0 选择科室 1 选择床位

    override fun convert(helper: BaseViewHolder?, item: BaseCheckDataBean?) {
        helper?.setText(R.id.tv_name, item?.name)
        helper?.setText(R.id.tvCode, "[ code - "+ item?.code+" ]")
        helper?.itemView?.setOnClickListener {
            onItemClick?.onListItemClick(item)
        }
    }

    fun setAdapterType(type: Int?) {
        this.type = type

    }


    private var onItemClick: onListItemClick? = null

    interface onListItemClick {
        fun onListItemClick(item: BaseCheckDataBean?)
    }

    fun onListItemClick(onListItemClick: onListItemClick?) {
        this.onItemClick = onListItemClick
    }


}
